Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "'flatbuffers::FieldDef* field' shadows a parameter" #7740

Merged
merged 1 commit into from
Jan 4, 2023
Merged

Fix "'flatbuffers::FieldDef* field' shadows a parameter" #7740

merged 1 commit into from
Jan 4, 2023

Conversation

rgiese
Copy link
Contributor

@rgiese rgiese commented Dec 25, 2022

Recent additions make gcc grouchy:

/usr/**********/flatbuffers/src/idl_gen_go.cpp: In lambda function:
/usr/**********/flatbuffers/src/idl_gen_go.cpp:506:41: error: declaration of 'flatbuffers::FieldDef* field' shadows a parameter [-Werror=shadow]
                      [&](FieldDef *field) { return field->key; });
                                         ^
/usr/**********/flatbuffers/src/idl_gen_go.cpp:497:55: note: shadowed declaration is here
                                       const FieldDef &field,
                                       ~~~~~~~~~~~~~~~~^~~~~

This change provides a fully local name for the lambda parameter.

@github-actions github-actions bot added c++ codegen Involving generating code from schema golang labels Dec 25, 2022
@dbaileychess
Copy link
Collaborator

Thanks, that's one rule I don't really like, as it forces you to make sometimes worst names than needed. But i could understand the shadowing aspect.

@dbaileychess dbaileychess merged commit 0158963 into google:master Jan 4, 2023
sunwen18 pushed a commit to sunwen18/flatbuffers that referenced this pull request Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ codegen Involving generating code from schema golang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants